package ks.client.gui.admin.user.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import ks.client.UserContext;
import ks.client.gui.admin.user.UserAdminGUI;
import ks.client.lobby.Lobby;


/**
 * 
 * This controller opens the user admin control window
 * where they are presented with various admin control
 * options related to user management.
 * 
 * @author Jennifer Hunt
 *
 */
public class UserAdminClickController implements ActionListener{
	
	Lobby lobby;
	UserContext context;
	
	/**
	 * Constructor for UserAdminClickController
	 * @param lobby
	 */
	public UserAdminClickController(Lobby lobby) {
		this.lobby = lobby;
		context = lobby.getUserContext();
	}
	
	/**
	 * 
	 * When the button is clicked the UserAdminGUi is displayed in a new frame.
	 * 
	 */
	public void actionPerformed(ActionEvent e){
		JFrame pma = new UserAdminGUI(lobby);
		pma.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		pma.setTitle("User Admin Controls");
		pma.setVisible(true);
	}
}
